home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / obero / oberon_lib.lha / oberon-a / source1.lha / source / 3rdParty / ums.mod < prev   
Text File  |  1994-08-08  |  21KB  |  666 lines

  1. (* UMS interface for Oberon-A
  2. ** Modified for Oberon-A Release 1.4 by Frank Copeland
  3. *)
  4.  
  5. MODULE ums;
  6.  
  7. (*
  8. ** $C- CaseChk       $I- IndexChk  $L+ LongAdr   $N- NilChk
  9. ** $P- PortableCode  $R- RangeChk  $S- StackChk  $T- TypeChk
  10. ** $V- OvflChk       $Z- ZeroVars
  11. *)
  12.  
  13.  
  14. IMPORT Utility, Exec, Intuition, SYSTEM;
  15.  
  16. CONST
  17.   name = "ums.library";
  18.  
  19. TYPE
  20.   UMSBasePtr * = CPOINTER TO UMSBase;
  21.   UMSBase * = RECORD (Exec.Library) END;
  22.  
  23. VAR
  24.   base * : UMSBasePtr;
  25.  
  26. TYPE
  27.   (* msgs are identified by the following type *)
  28.   NUM *         = LONGINT;
  29.  
  30.   (* general types *)
  31.  
  32. CONST
  33.   MaxMsgs *     = MAX(NUM);
  34.   NumFields *   = 128;
  35.  
  36. TYPE
  37.   APTR *        = Exec.APTR;
  38.   STRPTR* = Exec.STRPTR;
  39.  
  40.   oldMsg *      = ARRAY 16 OF STRPTR;
  41.   oldMsgPtr *   = CPOINTER TO oldMsg;
  42.  
  43.   MsgTextFields* = ARRAY NumFields OF STRPTR;
  44.   MessageInfo*  = RECORD
  45.                     hdrLen*     : LONGINT;
  46.                     txtLen*     : LONGINT;
  47.                     date*       : LONGINT;
  48.                     up*, dn*,
  49.                     lt*, rt*    : LONGINT;
  50.                     globalStat* : SET;
  51.                     userStat*   : SET;
  52.                     loginStat*  : SET;
  53.                     hardLink*   : LONGINT;
  54.                     softLink*   : LONGINT;
  55.                   END;
  56.  
  57. CONST
  58.  
  59.    (* enumeration of fields in an UMS-message *)
  60.  
  61.    msgText *    =  0;
  62.    fromName *   =  1;
  63.    fromAddr *   =  2;
  64.    toName *     =  3;
  65.    toAddr *     =  4;
  66.    msgID *      =  5;
  67.    creationDate*=  6;
  68.    receiveDate* =  7;
  69.    refID *      =  8;
  70.    group *      =  9;
  71.    subject *    = 10;
  72.    attributes * = 11;
  73.    comments *   = 12;
  74.    organization*= 13;
  75.    distribution*= 14;
  76.    folder*      = 15;
  77.    fidoID *     = 16;
  78.    mausID *     = 17;
  79.    replyGroup * = 18;
  80.    replyName *  = 19;
  81.    replyAddr *  = 20;
  82.    fidoText *   = 32;
  83.    errorText *  = 33;
  84.    newsreader * = 34;
  85.  
  86.  
  87.   (* user status-bits *)
  88.  
  89.   archive *   = 4;  (* msg should be archived, don't delete *)
  90.   junk *      = 5;  (* negative selection, inheritance suggested *)
  91.   postPoned * = 6;  (* to be read again, (but not now) *)
  92.   selected *  = 7;  (* positive selection, inheritance suggested *)
  93.   filtered *  = 15; (* msg has been processed by filter,
  94.                        'selected' and 'junk' have been properly set *)
  95.  
  96.   Old *         =  8; (* user has already read this Message *)
  97.   Read *        =  Old;
  98.   WriteAccess * =  9; (* user may change or delete this message *)
  99.   ReadAccess *  = 10; (* user may read this message *)
  100.   ViewAccess *  = 11; (* user may read the header of this message *)
  101.   Owner *       = 12; (* user 'owns' (wrote) this message *)
  102.  
  103.   ProtectedUserFlags*= {WriteAccess,ReadAccess,ViewAccess,Owner};
  104.  
  105.   (* global status-bits *)
  106.  
  107.   Deleted *     = 0; (* msg is really deleted *)
  108.   Expired *     = 1; (* msg has expired and may be deleted *)
  109.   Exported *    = 2; (* msg has been exported *)
  110.   Orphan *      = 3; (* msg could not be exported *)
  111.   Link *        = 4; (* within a ring of linked msgs *)
  112.   HardLink *    = 5; (* link is hardLink *)
  113.  
  114.   ProtectedGlobalFlags*= {Deleted,Exported,Orphan,Link,HardLink};
  115.  
  116. (*** Errors ***)
  117.  
  118. CONST
  119.   ok*           =  0;
  120.   unknown*      =  1;
  121.  
  122.   codeMissing*  = 100;
  123.   forbiddenCode*= 101;
  124.   noWriteAccess*= 102;
  125.   noReader*     = 103;
  126.   noExporter*   = 104;
  127.   badLink*      = 105;
  128.   noWork*       = 106;
  129.   noSysop*      = 107;
  130.   badChange*    = 108;
  131.  
  132.   dupe*         = 200;
  133.   noReadAccess* = 201;
  134.   noViewAccess* = 202;
  135.   msgCorrupted* = 203;
  136.   noHdrSpace*   = 204;
  137.   noSuchMsg*    = 205;
  138.   badName*      = 206;
  139.   badTag*       = 207;
  140.   missingTag*   = 208;
  141.   noSuchUser*   = 209;
  142.   notFound*     = 210;
  143.   autoBounce*   = 211;
  144.   msgDeleted*   = 212;
  145.   noNetAccess*  = 213;
  146.   badPattern*   = 214;
  147.   badVarname*   = 215;
  148.   fsFull*       = 216;
  149.   noMsgMem*     = 217;
  150.   missingIndex* = 218;
  151.  
  152.   serverTerminated*= 300;
  153.   cantWrite*    = 301;
  154.   cantRead*     = 302;
  155.   wrongMsgPtr*  = 303;
  156.   serverNotFree*= 304;
  157.   idCountProb*  = 305;
  158.   noLogin*      = 306;
  159.   wrongServer*  = 307;
  160.   noMem*        = 308;
  161.   wrongTask*    = 309;
  162.  
  163.  
  164.   (* tag-values *)
  165.  
  166.   typeSTRPTR    = 2000H;
  167.   typeVARPAR    = 4000H;
  168.  
  169.  
  170.   (** tags for WriteUMSMsg() **)
  171.  
  172.   (*  add 'typeVARPAR' for ReadUMSMsg()  *)
  173.   (*  no 'typeVARPAR' for WriteUMSMsg()  *)
  174.  
  175.   tagMsgNum *           =  1 + Utility.tagUser;
  176.  
  177.   tagMsgDate *          =  4 + Utility.tagUser;
  178.                                 (* don't usually use when writing!      *)
  179.                                 (* Using tagMsgDate with WriteUMSMsg()  *)
  180.                                 (* has a very special meaning.          *)
  181.   tagChainUp *          =  7 + Utility.tagUser;
  182.   tagHardLink *         = 14 + Utility.tagUser;
  183.   tagSoftLink *         = 15 + Utility.tagUser;
  184.  
  185.   tagAutoBounce *       = 65 + Utility.tagUser;
  186.                                 (* when writing:                                *)
  187.                                 (* data # 0: server returns error 'autoBounce', *)
  188.                                 (*           but still keeps the Msg and sends  *)
  189.                                 (*           it to the sysops.                  *)
  190.   tagHdrFill *          = 66 + Utility.tagUser;
  191.                                 (* when writing: how much bytes to be reserved  *)
  192.   tagTxtFill *          = 67 + Utility.tagUser;
  193.                                 (*               for header and text            *)
  194.   tagNoUpdate *         = 69 + Utility.tagUser; 
  195.                                 (* data = 0: (default) set 'Old'-Flag when      *)
  196.                                 (*           reading or writing                 *)
  197.                                 (* data = 1: don't touch 'Old'-Flag             *)
  198.   tagHide *             = 70 + Utility.tagUser;   
  199.                                 (* for writing:                                 *)
  200.                                 (* data = 0: default                            *)
  201.                                 (* data = 1: msg only accessible by exporters   *)
  202.                                 (* data = 2: msg only accessible by users       *)
  203.  
  204.   tagMsgText *          =  256 + typeSTRPTR + Utility.tagUser;
  205.   tagFromName *         = tagMsgText + 1;
  206.   tagFromAddr *         = tagMsgText + 2;
  207.   tagToName *           = tagMsgText + 3;
  208.   tagToAddr *           = tagMsgText + 4;
  209.   tagMsgID *            = tagMsgText + 5;
  210.   tagCreationDate *     = tagMsgText + 6;
  211.   tagReceiveDate *      = tagMsgText + 7;
  212.   tagRefID *            = tagMsgText + 8;
  213.   tagGroup *            = tagMsgText + 9;
  214.   tagSubject *          = tagMsgText +10;
  215.   tagAttributes *       = tagMsgText +11;
  216.   tagComments *         = tagMsgText +12;
  217.   tagOrganization *     = tagMsgText +13;
  218.   tagDistribution *     = tagMsgText +14;
  219.   tagFolder *           = tagMsgText +15;
  220.   tagFidoID *           = tagMsgText +16;
  221.   tagMausID *           = tagMsgText +17;
  222.   tagReplyGroup *       = tagMsgText +18;
  223.   tagReplyName *        = tagMsgText +19;
  224.   tagReplyAddr *        = tagMsgText +20;
  225.   tagFidoText *         = tagMsgText +32;
  226.   tagErrorText *        = tagMsgText +33;
  227.   tagNewsreader *       = tagMsgText +34;
  228.  
  229.   (* tagMsgText+15 .. tagMsgText+127 are also usable as text-fields *)
  230.  
  231.   tagTextFields *       = 513 + Utility.tagUser;
  232.                                 (* datatype: POINTER TO MsgTextFields *)
  233.  
  234.  
  235.   (** tags for ReadUMSMsg() **)
  236.  
  237.   (*  add 'typeVARPAR' for ReadUMSMsg()  *)
  238.   (*  no 'typeVARPAR' for WriteUMSMsg()  *)
  239.  
  240.   tagRMsgNum *          =  1 + Utility.tagUser;
  241.  
  242.   tagRHdrLength *       =  2 + Utility.tagUser + typeVARPAR;
  243.   tagRTxtLength *       =  3 + Utility.tagUser + typeVARPAR;
  244.   tagRMsgDate *         =  4 + Utility.tagUser + typeVARPAR;
  245.   tagRChainUp *         =  7 + Utility.tagUser + typeVARPAR;
  246.   tagRChainDn *         =  8 + Utility.tagUser + typeVARPAR;
  247.   tagRChainLt *         =  9 + Utility.tagUser + typeVARPAR;
  248.   tagRChainRt *         = 10 + Utility.tagUser + typeVARPAR;
  249.   tagRGlobalFlags *     = 11 + Utility.tagUser + typeVARPAR;
  250.   tagRUserFlags *       = 12 + Utility.tagUser + typeVARPAR;
  251.   tagRLoginFlags *      = 13 + Utility.tagUser + typeVARPAR;
  252.   tagRHardLink *        = 14 + Utility.tagUser + typeVARPAR;
  253.   tagRSoftLink *        = 15 + Utility.tagUser + typeVARPAR;
  254.  
  255.   tagRDateStyle *       = 64 + Utility.tagUser;
  256.                                 (* style for receiveDate when reading:          *)
  257.                                 (* data = 0: no receiveDate                     *)
  258.                                 (* data = 1: emulate old-style receiveDate      *)
  259.   tagRIDStyle *         = 68 + Utility.tagUser;
  260.                                 (* style for Message-ID                         *)
  261.                                 (* data = 0: real Message-ID                    *)
  262.                                 (* data = 1: old style dec-number               *)
  263.   tagRNoUpdate *        = 69 + Utility.tagUser;
  264.                                 (* data = 0: (default) set 'Old'-Flag when      *)
  265.                                 (*           reading or writing                 *)
  266.                                 (* data = 1: don't touch 'Old'-Flag             *)
  267.  
  268.   tagRMsgText *         =  256 + typeSTRPTR + typeVARPAR + Utility.tagUser;
  269.   tagRFromName *        = tagRMsgText + 1;
  270.   tagRFromAddr *        = tagRMsgText + 2;
  271.   tagRToName *          = tagRMsgText + 3;
  272.   tagRToAddr *          = tagRMsgText + 4;
  273.   tagRMsgID *           = tagRMsgText + 5;
  274.   tagRCreationDate *    = tagRMsgText + 6;
  275.   tagRReceiveDate *     = tagRMsgText + 7;
  276.   tagRRefID *           = tagRMsgText + 8;
  277.   tagRGroup *           = tagRMsgText + 9;
  278.   tagRSubject *         = tagRMsgText +10;
  279.   tagRAttributes *      = tagRMsgText +11;
  280.   tagRComments *        = tagRMsgText +12;
  281.   tagROrganization *    = tagRMsgText +13;
  282.   tagRDistribution *    = tagRMsgText +14;
  283.   tagRFolder *          = tagRMsgText +15;
  284.   tagRFidoID *          = tagRMsgText +16;
  285.   tagRMausID *          = tagRMsgText +17;
  286.   tagRReplyGroup *      = tagRMsgText +18;
  287.   tagRReplyName *       = tagRMsgText +19;
  288.   tagRReplyAddr *       = tagRMsgText +20;
  289.   tagRFidoText *        = tagRMsgText +32;
  290.   tagRErrorText *       = tagRMsgText +33;
  291.   tagRNewsreader *      = tagRMsgText +34;
  292.  
  293.   (* tagRMsgText+15 .. tagRMsgText+127 are also usable as text-fields *)
  294.  
  295.   tagRMsgInfo *         = 512 + Utility.tagUser;
  296.                                 (* datatype: POINTER TO MessageInfo *)
  297.   tagRTextFields *      = tagRMsgInfo + 1;
  298.                                 (* datatype: POINTER TO MsgTextFields *)
  299.  
  300.   tagRReadHeader *      = tagRMsgInfo + 2;
  301.                                 (* read all header-fields *)
  302.   tagRReadAll *         = tagRMsgInfo + 3;
  303.                                 (* read all text-fields *)
  304.  
  305.  
  306.   (** tags for UMSSelect()  **)
  307.  
  308.   tagSelSet *           = 1024 + Utility.tagUser;
  309.                                 (* flags to set on selected msgs *)
  310.   tagSelUnset *         = tagSelSet + 1;
  311.                                 (* flags to clear *)
  312.   tagSelWriteGlobal *   = tagSelSet + 2;
  313.                                 (* change global flags, not user-flags *)
  314.   tagSelWriteLocal *    = tagSelSet + 3;
  315.                                 (* change login-local flags, not user-flags *)
  316.   tagSelWriteUser *     = tagSelSet + 4+typeSTRPTR;
  317.                                 (* change other user's flags *)
  318.  
  319.   tagSelStart *         = tagSelSet + 8;
  320.                                 (* process only msgs AFTER this one *)
  321.   tagSelStop *          = tagSelSet + 9;
  322.                                 (* process only msgs BEFORE this one *)
  323.  
  324.   (* the following are mutual-exclusiv *)
  325.   (*   use only one of the following operations,   *)
  326.   (*   otherwise unpredictable things may happen!  *)
  327.  
  328.   tagSelReadGlobal *    = tagSelSet +10;
  329.                                 (* examine global flags, not user-flags *)
  330.   tagSelReadLocal *     = tagSelSet +11;
  331.                                 (* examine login-local flags, not user-flags *)
  332.   tagSelReadUser *      = tagSelSet +12+typeSTRPTR;
  333.                                 (* examine other user's flags *)
  334.   tagSelMask *          = tagSelSet +16;
  335.                                 (* select msgs, that's flags    *)
  336.   tagSelMatch *         = tagSelSet +17;
  337.                                 (*   ANDed with mask equal match *)
  338.   tagSelParent *        = tagSelSet +18;
  339.                                 (* examine parent's flags *)
  340.  
  341.   tagSelDate *          = tagSelSet +19;
  342.                                 (* select msgs younger than this date *)
  343.  
  344.   tagSelTree *          = tagSelSet +20;
  345.                                 (* select whole tree this msg is in *)
  346.  
  347.   tagSelSubTree *       = tagSelSet +21;
  348.                                 (* select sub-tree this msg is root of *)
  349.  
  350.   tagSelMsg *           = tagSelSet +22;
  351.                                 (* select a msg specified by number *)
  352.  
  353.   tagSelQuick *         = tagSelSet +23;
  354.                                 (* quick select enabled *)
  355.   (* tagMsgText .. tagMsgText+127 are also allowed for selecting *)
  356.  
  357.  
  358.   (** tags for UMSSearch() **)
  359.  
  360.   tagSearchLast *       = 2048 + Utility.tagUser;
  361.                                 (* number of LAST msg not to search *)
  362.   tagSearchQuick *      = tagSearchLast+ 1;
  363.                                 (* quick searches enabled *)
  364.  
  365.   tagSearchGlobal *     = tagSearchLast+ 2;
  366.                                 (* examine global flags instead of user-flags*)
  367.   tagSearchLocal *      = tagSearchLast+ 3;
  368.                                 (* examine login-local flags, not user-flags *)
  369.   tagSearchUser *       = tagSearchLast+ 4+typeSTRPTR;
  370.                                 (* examine other user's flags *)
  371.   tagSearchDirection *  = tagSearchLast+ 5;
  372.                                 (* set search direction *)
  373.                                 (*  0 = default  *)
  374.                                 (*  1 = forward  *)
  375.                                 (* -1 = backward *)
  376.   tagSearchPattern *    = tagSearchLast + 6;
  377.                                 (* string in tagMsgText .. tagMsgText+127 is: *)
  378.                                 (* 0: no pattern, just a plain string    *)
  379.                                 (* 1: an AmigaDOS style pattern          *)
  380.                                 (* 2: a pattern, only if it contains     *)
  381.                                 (*    wildcards ('auto-detect patterns') *)
  382.  
  383.   tagSearchMask *       = tagSearchLast+16;
  384.                                 (* search a msg, that's flags   *)
  385.   tagSearchMatch *      = tagSearchLast+17;
  386.                                 (*   ANDed with mask equal match *)
  387.  
  388.   (* tagMsgText .. tagMsgText+127 are also allowed for searching *)
  389.  
  390.  
  391.   (**  tags for ReadUMSConfig(), WriteUMSConfig()  **)
  392.  
  393.   tagCfgGlobalOnly *    = 3072 + Utility.tagUser;
  394.                                 (* read or write only global config,         *)
  395.                                 (* thus must not be combined with tagCfgUser *)
  396.   tagCfgName *          = tagCfgGlobalOnly+ 1 + typeSTRPTR;
  397.                                 (* name of config var to read or write       *)
  398.   tagCfgUser *          = tagCfgGlobalOnly+ 2 + typeSTRPTR;
  399.                                 (* name of user to read/write locals from/to *)
  400.  
  401.  
  402.   (**  tags for ReadUMSConfig()  **)
  403.  
  404.   tagCfgUserName *      = tagCfgGlobalOnly+ 3 + typeSTRPTR;
  405.                                 (* alias to get realname from                *)
  406.   tagCfgNextVar *       = tagCfgGlobalOnly+ 4 + typeSTRPTR;
  407.                                 (* get name of next var                      *)
  408.  
  409.  
  410.   (**  tags for WriteUMSConfig()  **)
  411.  
  412.   tagCfgDump *          = tagCfgGlobalOnly+16 + typeSTRPTR;
  413.                                 (* write current settings to a file *)
  414.   tagCfgData *          = tagCfgGlobalOnly+17 + typeSTRPTR;
  415.                                 (* data to write to specified var   *)
  416.  
  417.  
  418.  
  419.   (***  functions ***)
  420.  
  421. LIBCALL (base : UMSBasePtr) Login*
  422.   ( user[2]   : ARRAY OF CHAR;
  423.     passwd[3]  : ARRAY OF CHAR )
  424.   : LONGINT;
  425.   -30;
  426.  
  427. LIBCALL (base : UMSBasePtr) Logout*
  428.   ( account[2]    : LONGINT );
  429.   -36;
  430.  
  431. LIBCALL (base : UMSBasePtr) DumpConfig*
  432.   ( account[2]: LONGINT );
  433.   -114;
  434.  
  435. LIBCALL (base : UMSBasePtr) ErrNum*
  436.   ( account[2]: LONGINT )
  437.   : INTEGER;
  438.   -120;
  439.  
  440. LIBCALL (base : UMSBasePtr) ErrTxt*
  441.   ( account[2]: LONGINT )
  442.   : STRPTR;
  443.   -126;
  444.  
  445. LIBCALL (base : UMSBasePtr) DeleteMsg*
  446.   ( account[2]: LONGINT;
  447.     MsgNum[3] : NUM )
  448.   : BOOLEAN;
  449.   -132;
  450.  
  451. LIBCALL (base : UMSBasePtr) ChangeAttributes*
  452.   ( account[2]: LONGINT;
  453.     MsgNum[3] : NUM;
  454.     att[4]    : ARRAY OF CHAR )
  455.   : BOOLEAN;
  456.   -138;
  457.  
  458. LIBCALL (base : UMSBasePtr) NextStatus*
  459.   ( account[2]: LONGINT;
  460.     from[3]   : NUM;
  461.     mask[4]   : SET;
  462.     status[5] : SET )
  463.   : NUM;
  464.   -144;
  465.  
  466. LIBCALL (base : UMSBasePtr) SetStatus*
  467.   ( acc[2]   : LONGINT;
  468.     MsgNum[3] : NUM;
  469.     unset[4]  : SET;
  470.     set[5]: SET);
  471.   -162;
  472.  
  473. LIBCALL (base : UMSBasePtr) PrevStatus*
  474.   ( acc[2]   : LONGINT;
  475.     from[3]   : NUM;
  476.     mask[4]   : SET;
  477.     status[5] : SET )
  478.   : NUM;
  479.   -168;
  480.  
  481. LIBCALL (base : UMSBasePtr) SelStatus*
  482.   ( acc[2]   : LONGINT;
  483.     set[3]    : SET;
  484.     unset[4]  : SET;
  485.     mask[5]   : SET;
  486.     status[6] : SET )
  487.    : NUM;
  488.    -174;
  489.  
  490. LIBCALL (base : UMSBasePtr) SelGroup*
  491.   ( acc[2]   : LONGINT;
  492.     set[3]    : SET;
  493.     unset[4]  : SET;
  494.     group[5]  : ARRAY OF CHAR )
  495.   : NUM;
  496.   -180;
  497.  
  498. LIBCALL (base : UMSBasePtr) GetStatus*
  499.   ( acc[2]   : LONGINT;
  500.     MsgNum[3] : LONGINT )
  501.   : SET;
  502.   -186;
  503.  
  504. LIBCALL (base : UMSBasePtr) FlushUMS*(); -192;
  505.  
  506. LIBCALL (base : UMSBasePtr) CleanMB*() : INTEGER; -198;
  507.  
  508. LIBCALL (base : UMSBasePtr) QuitUMS*(); -204;
  509.  
  510.  
  511. (*** V8: ***)
  512.  
  513. LIBCALL (base : UMSBasePtr) UMSARexxQuery*(); -210;
  514.  
  515. (*** V9: ***)
  516.  
  517. LIBCALL (base : UMSBasePtr) ExportedMsg*
  518.   ( acc[2]   : LONGINT;
  519.     num[3]    : LONGINT );
  520.   -234;
  521.  
  522. LIBCALL (base : UMSBasePtr) CannotExport*
  523.   ( acc[2]   : LONGINT;
  524.     num[3]    : LONGINT;
  525.     error[4]  : ARRAY OF CHAR )
  526.   : BOOLEAN;
  527.   -240;
  528.  
  529. LIBCALL (base : UMSBasePtr) LogUMS*
  530.   ( acc[2]   : LONGINT;
  531.     level[4]  : LONGINT;
  532.     format[5] : ARRAY OF CHAR;
  533.     args[6]   : ARRAY OF SYSTEM.BYTE );
  534.   -246;
  535.  
  536. LIBCALL (base : UMSBasePtr) LogUms*
  537.   ( acc[2]   : LONGINT;
  538.     level[4]  : LONGINT;
  539.     format[5] : ARRAY OF CHAR;
  540.     args[6].. : LONGINT );
  541.   -246;
  542.  
  543. LIBCALL (base : UMSBasePtr) UMSRLogin*
  544.   ( server[2]    : ARRAY OF CHAR;
  545.     user[3]   : ARRAY OF CHAR;
  546.     passwd[4] : ARRAY OF CHAR )
  547.   : LONGINT;
  548.   -252;
  549.  
  550. LIBCALL (base : UMSBasePtr) WriteUMSMsg*
  551.   ( acc[2]   : LONGINT;
  552.     tagItems[3]: ARRAY OF Utility.TagItem )
  553.   : LONGINT;
  554.   -258;
  555.  
  556. LIBCALL (base : UMSBasePtr) WriteUMSMsgTags*
  557.   ( acc[2]   : LONGINT;
  558.     tagItems[3]..: Utility.Tag )
  559.   : LONGINT;
  560.   -258;
  561.  
  562. LIBCALL (base : UMSBasePtr) ReadUMSMsg*
  563.   ( acc[2]   : LONGINT;
  564.     tagItems[3]: ARRAY OF Utility.TagItem )
  565.   : BOOLEAN;
  566.   -264;
  567.  
  568. LIBCALL (base : UMSBasePtr) ReadUMSMsgTags*
  569.   ( acc[2]   : LONGINT;
  570.     tagItems[3]..: Utility.Tag )
  571.   : LONGINT;
  572.   -264;
  573.  
  574. LIBCALL (base : UMSBasePtr) FreeUMSMsg*
  575.   ( acc[2]   : LONGINT;
  576.     msgNum[3] : LONGINT );
  577.   -270;
  578.  
  579. LIBCALL (base : UMSBasePtr) UMSSelect*
  580.   ( acc[2]   : LONGINT;
  581.     tagItems[3]: ARRAY OF Utility.TagItem )
  582.   : LONGINT;
  583.   -276;
  584.  
  585. LIBCALL (base : UMSBasePtr) UMSSelectTags*
  586.   ( acc[2]   : LONGINT;
  587.     tagItems[3]..: Utility.Tag )
  588.   : LONGINT;
  589.   -276;
  590.  
  591. LIBCALL (base : UMSBasePtr) UMSSearch*
  592.   ( acc[2]   : LONGINT;
  593.     tagItems[3]: ARRAY OF Utility.TagItem )
  594.   : LONGINT;
  595.   -282;
  596.  
  597. LIBCALL (base : UMSBasePtr) UMSSearchTags*
  598.   ( acc[2]   : LONGINT;
  599.     tagItems[3]..: Utility.Tag )
  600.   : LONGINT;
  601.   -282;
  602.  
  603. LIBCALL (base : UMSBasePtr) ReadUMSConfig*
  604.   ( acc[2]: LONGINT;
  605.     tagItems[3]: ARRAY OF Utility.TagItem )
  606.   : STRPTR;
  607.   -288;
  608.  
  609. LIBCALL (base : UMSBasePtr) ReadUMSConfigTags*
  610.   ( acc[2]: LONGINT;
  611.     tagItems[3]..: Utility.Tag )
  612.   : STRPTR;
  613.   -288;
  614.  
  615. LIBCALL (base : UMSBasePtr) FreeUMSConfig*
  616.   ( acc[2]   : LONGINT;
  617.     str[3]    : STRPTR);
  618.   -294;
  619.  
  620. LIBCALL (base : UMSBasePtr) WriteUMSConfig*
  621.   ( acc[2]: LONGINT;
  622.     tagItems[3]: ARRAY OF Utility.TagItem )
  623.   : BOOLEAN;
  624.   -300;
  625.  
  626. LIBCALL (base : UMSBasePtr) WriteUMSConfigTags*
  627.   ( acc[2]: LONGINT;
  628.     tagItems[3]..: Utility.Tag )
  629.   : BOOLEAN;
  630.   -300;
  631.  
  632. LIBCALL (base : UMSBasePtr) PrivateServerCall*
  633.   ( command[2]: LONGINT;
  634.     arg[3]    : APTR )
  635.   : LONGINT;
  636.   -306;
  637.  
  638. (* $L- Address globals through A4 *)
  639.  
  640. (*-----------------------------------*)
  641. PROCEDURE* CloseLib;
  642.  
  643. BEGIN
  644.   IF base # NIL THEN Exec.base.CloseLibrary (base) END;
  645. END CloseLib;
  646.  
  647. (*-----------------------------------*)
  648. PROCEDURE OpenLib * (mustOpen : BOOLEAN);
  649.  
  650. BEGIN
  651.   IF base = NIL THEN
  652.     base :=
  653.       SYSTEM.VAL
  654.         ( UMSBasePtr,
  655.           Exec.base.OpenLibrary (name, 0));
  656.     IF base # NIL THEN SYSTEM.SETCLEANUP (CloseLib)
  657.     ELSIF mustOpen THEN HALT (100)
  658.     END
  659.   END
  660. END OpenLib;
  661.  
  662. BEGIN
  663.   base := NIL
  664. END ums.
  665.  
  666.